import React,{lazy} from "react";
import {Navigate} from "react-router-dom";
import type { RouteObject } from "react-router-dom";

// import Discover from "@/views/discover/index.tsx";
// import Focus from "@/views/focus/index.tsx";
// import Mine from "@/views/mine/index.tsx";
// import Download from "@/views/download/index.tsx";

const Discover = lazy(()=>import("@/views/discover/index.tsx"));
const Focus = lazy(()=>import("@/views/focus/index.tsx"));
const Mine = lazy(()=>import("@/views/mine/index.tsx"));
const Download = lazy(()=>import("@/views/download/index.tsx"));

const Recommand = lazy(()=>import("@/views/discover/c-views/recommand/index.tsx"));
const Ranking = lazy(()=>import("@/views/discover/c-views/ranking/index.tsx"));
const Songs = lazy(()=>import("@/views/discover/c-views/songs/index.tsx"));
const Djradio = lazy(()=>import("@/views/discover/c-views/djradio/index.tsx"));
const Artist = lazy(()=>import("@/views/discover/c-views/artist/index.tsx"));
const Album = lazy(()=>import("@/views/discover/c-views/album/index.tsx"));

const routes:RouteObject[] = [
    {
        path:"/",
        element:<Navigate to="/discover"/>
    },
    {
        path:"/discover",
        element:<Discover />,
        children:[
            {
                path:"/discover",
                element:<Navigate to="/discover/recommand" />
            },
            {
                path:"/discover/recommand",
                element:<Recommand />
            },
            {
                path:"/discover/ranking",
                element:<Ranking />
            },
            {
                path:"/discover/songs",
                element:<Songs />
            },
            {
                path:"/discover/djradio",
                element:<Djradio />
            },
            {
                path:"/discover/artist",
                element:<Artist />
            },
            {
                path:"/discover/album",
                element:<Album />
            }
        ]
    },
    {
        path:"/focus",
        element:<Focus />
    },
    {
        path:"/mine",
        element:<Mine />
    },
    {
        path:"/download",
        element:<Download />
    }
];

export default routes;
